﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Marmat.Forms.Design
{
    public interface ISmartMatchControl
    {
        /// <summary>
        /// 获取参与字段信息匹配的控件类型
        /// </summary>
        /// <returns></returns>
        Type[] GetCollection();

        /// <summary>
        /// 根据字段信息匹配相应的控件类型
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        Type Match(SmartMatchControlInfo info);
    }

    public class SmartMatchControlInfo
    {
        /// <summary>
        /// 属性名称
        /// </summary>
        public string PropertyName { get; set; }

        /// <summary>
        /// 属性标题
        /// </summary>
        public string Caption { get; set; }

        /// <summary>
        /// 属性类型
        /// </summary>
        public Type PropertyType { get; set; }
    }
}
